/**
 * TODO js时间戳转成日期格式
 * exmple formatDate(new Date(1245123412))
 */
function formatDate(now)   {     
      var year=now.getYear().toString();     
      var month=now.getMonth()+1;     
      var date=now.getDate();     
      var hour=now.getHours();     
      var minute=now.getMinutes();     
      var second=now.getSeconds();     
      if(month<10)
      {
      	month='0'+month;
      }
      if(date<10)
      {
    	  date='0'+date;
      }
      return "20"+year.substr(1,year.length)+"-"+month+"-"+date;
}

/**
 * TODO js时间戳转成日期格式(yyyy-MM-dd HH:mm:ss)
 * exmple formatDate(new Date(1245123412))
 */
function formatFullDate(now)   {     
      var year=now.getYear().toString();     
      var month=now.getMonth()+1;     
      var date=now.getDate();     
      var hour=now.getHours();     
      var minute=now.getMinutes();     
      var second=now.getSeconds();     
      if(month<10)
      {
      	month='0'+month;
      }
      if(date<10)
      {
    	  date='0'+date;
      }
      if(hour<10)
      {
    	  hour='0'+hour;
      }
      if(minute<10)
      {
    	  minute='0'+minute;
      }
      if(second<10)
      {
    	  second='0'+second;
      }
      return "20"+year.substr(1,year.length)+"-"+month+"-"+date+" "+hour+":"+minute+":"+second;
}

/**
 * 格式化年
 * @param now 
 * @returns {YYYY}
 */
function formatYearDate(now)   {     
    var year=now.getYear().toString();     
    return "20"+year.substr(1,year.length);
}

/**
 * 格式化月
 * @param now
 * @returns {MM}
 */
function formatMonthDate(now)   {     
	var month=now.getMonth()+1;
	if(month<10)
    {
    	month='0'+month;
    }
    return month;
}

/**
 * 格式化日
 * @param now
 * @returns {DD}
 */
function formatDayDate(now)   {     
	var date=now.getDate(); 
	if(date<10)
    {
		date='0'+date;
    }
    return date;
}